Optimal. Leaf size=127 \[ \frac {a (3 A+2 (B+C)) \tan (c+d x)}{3 d}+\frac {a (4 A+4 B+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a (4 A+4 B+3 C) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {a (B+C) \tan (c+d x) \sec ^2(c+d x)}{3 d}+\frac {a C \tan (c+d x) \sec ^3(c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.180, Rules used = {4076, 4047, 3768, 3770, 4046, 3767, 8} \[ \frac {a (3 A+2 (B+C)) \tan (c+d x)}{3 d}+\frac {a (4 A+4 B+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a (4 A+4 B+3 C) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {a (B+C) \tan (c+d x) \sec ^2(c+d x)}{3 d}+\frac {a C \tan (c+d x) \sec ^3(c+d x)}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3768
Rule 3770
Rule 4046
Rule 4047
Rule 4076
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {a C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec ^2(c+d x) \left (4 a A+a (4 A+4 B+3 C) \sec (c+d x)+4 a (B+C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec ^2(c+d x) \left (4 a A+4 a (B+C) \sec ^2(c+d x)\right ) \, dx+\frac {1}{4} (a (4 A+4 B+3 C)) \int \sec ^3(c+d x) \, dx\\ &=\frac {a (4 A+4 B+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (B+C) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {a C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{8} (a (4 A+4 B+3 C)) \int \sec (c+d x) \, dx+\frac {1}{3} (a (3 A+2 (B+C))) \int \sec ^2(c+d x) \, dx\\ &=\frac {a (4 A+4 B+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a (4 A+4 B+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (B+C) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {a C \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {(a (3 A+2 (B+C))) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {a (4 A+4 B+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a (3 A+2 (B+C)) \tan (c+d x)}{3 d}+\frac {a (4 A+4 B+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (B+C) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {a C \sec ^3(c+d x) \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.78, size = 84, normalized size = 0.66 \[ \frac {a \left (3 (4 A+4 B+3 C) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (3 (4 A+4 B+3 C) \sec (c+d x)+24 (A+B+C)+8 (B+C) \tan ^2(c+d x)+6 C \sec ^3(c+d x)\right )\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.44, size = 143, normalized size = 1.13 \[ \frac {3 \, {\left (4 \, A + 4 \, B + 3 \, C\right )} a \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, A + 4 \, B + 3 \, C\right )} a \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (3 \, A + 2 \, B + 2 \, C\right )} a \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, A + 4 \, B + 3 \, C\right )} a \cos \left (d x + c\right )^{2} + 8 \, {\left (B + C\right )} a \cos \left (d x + c\right ) + 6 \, C a\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.27, size = 254, normalized size = 2.00 \[ \frac {3 \, {\left (4 \, A a + 4 \, B a + 3 \, C a\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, A a + 4 \, B a + 3 \, C a\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (12 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 9 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 60 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 28 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 49 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 84 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 52 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 31 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 36 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 39 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.76, size = 223, normalized size = 1.76 \[ \frac {a A \tan \left (d x +c \right )}{d}+\frac {a B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 a C \tan \left (d x +c \right )}{3 d}+\frac {a C \left (\sec ^{2}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{3 d}+\frac {a A \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 a B \tan \left (d x +c \right )}{3 d}+\frac {a B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d}+\frac {a C \left (\sec ^{3}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{4 d}+\frac {3 a C \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {3 a C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.37, size = 218, normalized size = 1.72 \[ \frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a - 3 \, C a {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, B a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a \tan \left (d x + c\right )}{48 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.54, size = 211, normalized size = 1.66 \[ \frac {\left (-A\,a-B\,a-\frac {3\,C\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (5\,A\,a+\frac {7\,B\,a}{3}+\frac {49\,C\,a}{12}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-7\,A\,a-\frac {13\,B\,a}{3}-\frac {31\,C\,a}{12}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (3\,A\,a+3\,B\,a+\frac {13\,C\,a}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {a\,\mathrm {atanh}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,A+4\,B+3\,C\right )}{2\,\left (2\,A\,a+2\,B\,a+\frac {3\,C\,a}{2}\right )}\right )\,\left (4\,A+4\,B+3\,C\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a \left (\int A \sec ^{2}{\left (c + d x \right )}\, dx + \int A \sec ^{3}{\left (c + d x \right )}\, dx + \int B \sec ^{3}{\left (c + d x \right )}\, dx + \int B \sec ^{4}{\left (c + d x \right )}\, dx + \int C \sec ^{4}{\left (c + d x \right )}\, dx + \int C \sec ^{5}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________